"""pytest中共享fixture模块"""
import pytest
import requests
from config.config import Config
@pytest.fixture()
def token():
    cc = Config()
    #print(cc.get_token("app_key"))
    data = {
        "app_key":cc.get_token("app_key"),
        "username":cc.get_token("username"),
        "password":cc.get_token("password")
    }
    r = requests.post(url="http://hn216.api.yesapi.cn/api/App/User/login",data=data)
    r = r.json()
    return  r.get("data").get("token")
#print(token())